<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<title>{$types.name} - {$configs.WEBNAME}</title>	
		{include file="public/web_top"}
		<link rel="stylesheet" href="__PUBLIC__/m/layui/css/layui.css" />
	</head>
	<body>
	{if condition="$types['imgpath2']"}
	<div class="index_flash">
		<img src="__ROOT__/{$types.imgpath2}" alt="{$types.name}" />
	</div>
	{/if}
	<div class="list2" id="LAY_demo">
		
	</div>
	<a href="{:url('mobile/contact/index')}" class="bt" style="color: #ddd;">我要做一个一样的...</a>
	</body>
	<script src="__PUBLIC__/m/js/jquery-1.11.3.min.js"></script>
	<script src="__PUBLIC__/m/layui/layui.js"></script> 
	<script>        
        layui.use(['flow'], function () {
            var $ = layui.$
                , flow = layui.flow;            
            // 流布局
            flow.load({
                elem: '#LAY_demo'
                , done: function(page, next){
                    var lis = [];
                    var title = $("#title").val();              
                    $.ajax({
                        type: "POST",
                        contentType:"application/x-www-form-urlencoded; charset=UTF-8",
                        url: "{:url('mobile/index/lst')}",
                        data: {pageNum:page,pageSize:10,cid:"{$type.id}",sid:"{$types.id}",title:title},
                        error:function(msg){
                            alert("错误");
                        },
                        success:function(data){
                            var lis = [];
                            var html = '';
                            setTimeout(function(){
                                $.each(data.data,function (key,val) {                                   
                                    html += '<a href="'+val.href+'" class="item">';
										html += '<img src="__PUBLIC__/m/img/3.png" class="ico" />';
										html += '<div class="txt">';
											html += '<p>'+val.name+'</p>';
											html += '<i>'+val.filesize+' KB</i>';
										html += '</div>';
									html += '</a>';                                 
                                })
                                lis.push(html)
                                next(lis.join(''), page < data.totalPage);
                            }, 500);      
                        }
                    }); 
                },
            });

        });
    </script>
</html>
